import axios from '@/units/request.js';
export function login(data) {
  return axios({
    url: '/login',
    method: 'post',
    data,
  });
}

//添加用户名
export function adddUser(data) {
  return axios({
    url: '/adddUser',
    method: 'post',
    data,
  });
}

//栏目列表
export function getType(data) {
  return axios({
    url: '/getType',
    method: 'get',
    data,
  });
}

//删除栏目
export function delType(data) {
  return axios({
    url: '/delType',
    method: 'post',
    data,
  });
}

//新增栏目
export function adddType(data) {
  return axios({
    url: '/adddType',
    method: 'post',
    data,
  });
}

//新增动物
export function adddAnimal(data) {
  return axios({
    url: '/adddAnimal',
    method: 'post',
    data,
  });
}

//上传图片
export function upload(formdata) {
  return axios.post('/upload', formdata, {
    headers: {
      'Content-Type': 'multipart/form-data',
    },
    transformRequest: [
      function (data) {
        return data;
      },
    ],
  });
}

//获取动物列表
export function getAnimalList(params) {
  return axios({
    url: '/getAnimalList',
    method: 'get',
    params,
  });
}

//删除动物
export function delAnimal(data) {
  return axios({
    url: '/delAnimal',
    method: 'post',
    data,
  });
}
